# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import models


from odoo import api, SUPERUSER_ID


def post_init(cr, registry):
    env = api.Environment(cr, SUPERUSER_ID, {})

    company_ids = env['res.company'].search(
        [('chart_template_id', '!=', False)])

    # 安装本模块时, 所有的公司, 更正 transfer_account

    for company_id in company_ids:
        chart_template_id = company_id.chart_template_id
        chart_template_id._set_company_transfer_account(company_id)
